package com.rftennis.dto;
/**
 * 公共查询结果DTO
 * @author Administrator
 *
 */

import java.util.List;
import java.util.function.Function;
import java.util.stream.Collectors;

public class ItemResult<T> {
	
	private 	List<T> rows;
	

	public List<T> getRows() {
		return rows;
	}
	public void setRows(List<T> rows) {
		this.rows = rows;
	}
	
	public <X>ItemResult<X> rowsMap(Function<T, X> mapper){
		ItemResult<X> qr=new ItemResult<>();
		
	
		if(this.rows!=null) {
			qr.setRows(this.rows.stream().map(mapper).collect(Collectors.toList()));	
		}
		return qr;
	}
	@Override
	public String toString() {
		return "ItemResult [rows=" + rows + "]";
	}
	
	
	
	
	
	
}
